package cn.fastoo.web.backstage.web.controller.common;

import cn.fastoo.common.dao.product.ProductCategoryDao;
import cn.fastoo.common.dao.system.AdminSystemOrganizationDao;
import cn.fastoo.common.dao.system.UserBaseInfoDao;
import cn.fastoo.common.sampleframe.dto.JsonResult;
import cn.fastoo.common.sampleframe.search.Search;
import cn.fastoo.common.service.OSSService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.UUID;


@Controller
@RequestMapping("/common")
public class CommonController {
	private static Logger logger = LoggerFactory.getLogger(CommonController.class);

	@Autowired
	private AdminSystemOrganizationDao adminSystemOrganizationDao;
	@Autowired
	private ProductCategoryDao productCategoryDao;
	@Autowired
	private UserBaseInfoDao userBaseInfoDao;

	@RequestMapping(value = "/getAllCampus")
	@ResponseBody
	public String getAllCampus() {
		 return JsonResult.success(adminSystemOrganizationDao.getAllCampus());
	}

	@RequestMapping(value = "/getGuwens")
	@ResponseBody
	public String getGuwens() {
		return JsonResult.success(userBaseInfoDao.findGuwen());
	}

	@RequestMapping(value = "/getAllProductCategorys")
	@ResponseBody
	public String getAllProductCategorys() {
		return JsonResult.success(productCategoryDao.find(new Search()));
	}





}
